#ifndef GAMEBOY_H
#define GAMEBOY_H
#include "Commons.h"
#include "Cartridge.h"
#include "Z80.h"
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
class GameBoy {
    public:
        virtual                 ~GameBoy();
        static GameBoy*         GetSingleton();
        bool                    LoadFile( const char* )const;
        u8                      ReadMemory( u16 )const;
        void                    WriteMemory( u16, u8 );
        void                    LaunchEmulation();
        void                    Reset();
        
    private:
                                GameBoy();
        void                    UpdateGraphics( int );
        void                    HandleInterrupts();
        void                    RequestInterrupt( u8 );
        static GameBoy*         m_Instance;
        Cartridge*              m_Cart;
        Z80*                    m_Z80;
        u8*                     m_ROM;
        u8*                     m_Bank;
        u8*                     m_Port;
        int                     m_ScanlineCycles;
};
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
#endif
